package top.vanchor.myblog2back.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import top.vanchor.myblog2back.entity.BlogBlog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Ding
 * @since 2021-11-12
 */
@Mapper
public interface BlogBlogMapper extends BaseMapper<BlogBlog> {

    List<Map<String, Object>> getBlogById(@Param("blogId") Integer blog_id,@Param("uId") Integer uId);

    int toDelBlogById(@Param("blogId") int blog_id);

    int hiddenBlogById(@Param("blogId") int blog_id,@Param("type") int type);

    int noHiddenBlogById(@Param("blogId") int blog_id);

    List<Map<String, Object>> getSearchBlogJson(@Param("searchData") String searchText,@Param("uId") Integer uId,@Param("type") Integer type,@Param("list") List<Integer> starIds);

    int addViewTime(@Param("blogId") int blogId);

    int toLikeOrUnlikeBlog(@Param("blogId") Integer blogId,@Param("type") Integer type,@Param("uId") Integer uId);

    int toUpdate(@Param("data") BlogBlog data);
}
